package com.rfy.base.entity.request;

import io.swagger.annotations.ApiModelProperty;

/**
 * @author zhang
 * @date: 2018-12-22 16:28
 * @description：响应信息
 */
public abstract class BasePageRequest extends BaseRequest {

    /**
     * 每页默认大小
     */
    public static final int PAGESIZE_DEFAULT = 5;

    /**
     * 每页数量
     */
    @ApiModelProperty(value="每页大小")
    protected int pageSize;

    /**
     * 页码
     */
    @ApiModelProperty(value="页码")
    protected int pageNum;

    public final int getPageSize() {
        return pageSize;
    }

    public final void setPageSize(int pageSize) {
        if(pageSize<1||pageSize>50){
            pageSize = PAGESIZE_DEFAULT;
        }
        this.pageSize = pageSize;
    }

    public final int getPageNum() {
        return pageNum;
    }

    public final void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }
}
